<?php
/*
 * @Author       : chaihao
 * @Date         : 2020-10-14 09:35:48
 * @LastEditTime : 2020-10-15 17:08:27
 * @FilePath     : /ai/controllers/data/RoomCOntroller.php
 * @author: chaihao <chaihao0823@gmail.com>
 */


namespace app\controllers\data;

use app\commands\ErrorMsg;
use app\commands\Helper;
use app\commands\Validator;
use app\Services\api\RoomService;
use yii\web\Controller;

class RoomController extends Controller
{
    /**
     * 获取已开启房间基本信息
     */
    public function actionGetList()
    {
        $req = Helper::in(array_merge($_POST, $_GET));
        $rules = array(
            'token'  => 'required',
        );
        Validator::validator($req, $rules, ErrorMsg::ERROR_MSG);
        $res = RoomService::getInstance()->getList();
        Helper::right_out($req, $res);
    }
}
